#define _CRT_SECURE_NO_WARNINGS
#include<string.h>
#include<iostream>
using namespace std;
class Solution {
public:
    bool digitCount(string num) {
        string nums = num;
        for (int i = 0; i < num.size(); i++)
        {

            nums[num[i] - '0'] -= 1;
            if (nums[num[i] - '0'] < 0)
                return false;
        }
        for (int i = 0; i < num.size(); i++)
        {
            if (nums[i] != '0')
                return false;
        }
        return true;
    }

};